//
//  AddingDeviceViewModel.swift
//  casdon_swiftUI
//
//  Created by ww on 2025/5/20.
//

import SwiftUI
import Combine

class AddingDeviceViewModel: ObservableObject {
    @Published var currentStep: SetupStep = .authentication
    @Published var stepStatuses: [StepStatus] = Array(repeating: .noState, count: SetupStep.allCases.count)

    // 进入下一个步骤
    func advanceStep() {
        let currentIndex = currentStep.rawValue
        guard currentIndex < SetupStep.allCases.count else { return }

        // 标记当前完成
        stepStatuses[currentIndex] = .doneState

        // 进入下一步（如果有）
        if currentIndex + 1 < SetupStep.allCases.count {
            currentStep = SetupStep(rawValue: currentIndex + 1)!
            stepStatuses[currentIndex + 1] = .ingState
        }
    }

    
}
